<template>
  <div class="box">
    <div class="box-one">
      <p>筛选搜索</p>
      <div class="div-rig">
        <el-button type="primary" >重置</el-button>
        <el-button type="primary" >查询</el-button>
      </div>
    </div>
    <el-divider />
    <!-- 搜索框 -->
    商品搜索：
    <el-input
      v-model="search"
      style="width: 240px"
      placeholder="请输入关键词"
    />
    <el-dropdown @command="handleCommand">
    <span class="el-dropdown-link">
      商品分类
    <el-icon class="el-icon--right"><arrow-down /></el-icon>
    </span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item command="a">Action 1</el-dropdown-item>
        <el-dropdown-item command="b">Action 2</el-dropdown-item>
        <el-dropdown-item command="c">Action 3</el-dropdown-item>
        <el-dropdown-item command="d" disabled>Action 4</el-dropdown-item>
        <el-dropdown-item command="e" divided>Action 5</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { ElMessage } from "element-plus";
import { ArrowDown } from "@element-plus/icons-vue";

const search = ref("");

const handleCommand = (command: string | number | object) => {
  ElMessage(`click on item ${command}`);
};
</script>

<style scoped>
.box {
  width: 100%;
  height: 200px;
  background-color: rgb(255, 255, 255);
  margin: 10px auto;
}
.box-one {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.box-one p {
  padding: 20px 20px;
  font-size: 16px;
  display: flex;
}
.example-showcase .el-dropdown-link {
  cursor: pointer;
  color: var(--el-color-primary);
  display: flex;
  align-items: center;
}
</style>